<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-html" prefix="html"%>
<%@ taglib uri="/struts-bean" prefix="bean"%>
<%@ taglib uri="/struts-logic" prefix="logic"%>
<%@ taglib uri="/struts-nested" prefix="nested"%>
<%@ taglib uri="/terasoluna-struts" prefix="ts"%>
<%@ taglib uri="/terasoluna" prefix="t"%>
<%@ taglib uri="/terasoluna-library" prefix="tl"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String imagePath = basePath + "admin/images";
%>
<html:html>
<head>
<title></title>
<link href="<%=request.getContextPath()%>/admin/css/tcmsystem.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ts:form action="/setRoleMenu.do" method="post">
<table width="30%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td height="30" background="<%=imagePath%>/tab_05.gif">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="12" height="30"><img src="<%=imagePath%>/tab_03.gif" width="12" height="30" /></td>
				<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td width="46%" valign="middle">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="5%"><div align="center"><img src="<%=imagePath%>/tb.gif" width="16" height="16" /></div></td>
							<td width="95%" class="STYLE1"><span class="STYLE3">你当前的位置</span>：[系统管理]-[角色菜单设置]</td>
						</tr>
					</table>
					</td>
				</tr>
				</table>
				</td>
				<td width="16"><img src="<%=imagePath%>/tab_07.gif" width="16" height="30" /></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="8" background="<%=imagePath%>/tab_12.gif">&nbsp;</td>
			<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
				<tr>
					<td width="40%" height="30" align="center" bgcolor="#FFFFFF" class="STYLE1">主菜单</td>
					<td width="40%" height="30" bgcolor="#FFFFFF" class="STYLE1">子菜单</td>
					<td width="20%" height="30" bgcolor="#FFFFFF" class="STYLE1" align="center">设置</td>
				</tr>
				<% int index = 0; %>
				<html:hidden property="id"/>
				<logic:iterate id="mainMenu" name="mainMenuList" scope="request">
				<tr>
					<td width="40%" height="30" align="center" bgcolor="#FFFFFF" class="STYLE1">
					<bean:write name="mainMenu" property="title"/>
					<bean:define id="menuId" name="mainMenu" property="id" type="java.lang.Integer"/>
					<input type="hidden" name="roleMenuList[<%=index%>].menuId" value="<%=menuId%>">
					</td>
					<td width="40%" height="30" bgcolor="#FFFFFF" class="STYLE1"></td>
					<td width="20%" height="30" bgcolor="#FFFFFF" class="STYLE1" align="center">
					<logic:equal value="1" name="mainMenu" property="hasRole">
					<input type="checkbox" name="roleMenuList[<%=index%>].hasRole" checked="checked" value="1"> 
					</logic:equal>
					<logic:equal value="0" name="mainMenu" property="hasRole">
					<input type="checkbox" name="roleMenuList[<%=index%>].hasRole" value="1"> 
					</logic:equal>
					<input type="hidden" name="roleMenuList[<%=index%>].hasRole" value="0"> 
					<%index++;%>
					</td>
				</tr>
				<logic:iterate id="subMenu" name="mainMenu" property="menuList">
				<tr>
					<td width="40%" height="30" align="center" bgcolor="#FFFFFF" class="STYLE1"></td>
					<td width="40%" height="30" bgcolor="#FFFFFF" class="STYLE1">
					<bean:write name="subMenu" property="title"/>
					<bean:define id="menuId" name="subMenu" property="id" type="java.lang.Integer"/>
					<input type="hidden" name="roleMenuList[<%=index%>].menuId" value="<%=menuId%>">
					</td>
					<td width="20%" height="30" bgcolor="#FFFFFF" class="STYLE1" align="center">
					<logic:equal value="1" name="subMenu" property="hasRole">
					<input type="checkbox" name="roleMenuList[<%=index%>].hasRole" checked="checked" value="1"> 
					</logic:equal>
					<logic:equal value="0" name="subMenu" property="hasRole">
					<input type="checkbox" name="roleMenuList[<%=index%>].hasRole" value="1"> 
					</logic:equal>
					<input type="hidden" name="roleMenuList[<%=index%>].hasRole" value="0">
					<%index++;%>
					</td>
				</tr>
				</logic:iterate>
				</logic:iterate>
				<tr>
					<td height="30" align="center" bgcolor="#FFFFFF" class="STYLE1" colspan="3">
					<html:submit value="权限设置"></html:submit><input type="button" value="返回上一页" onclick="location.href='./roleList.do'">
					</td>
				</tr>
			</table>
			</td>
			<td width="8" background="<%=imagePath%>/tab_15.gif">&nbsp;</td>
		</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td height="35" background="<%=imagePath%>/tab_19.gif">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="12" height="35"><img src="<%=imagePath%>/tab_18.gif" width="12" height="35" /></td>
				<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td class="STYLE4">&nbsp;</td>
							<td></td>
						</tr>
					</table></td>
				<td width="16"><img src="<%=imagePath%>/tab_20.gif" width="16" height="35" /></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</ts:form>
</body>
</html:html>
